﻿using System.Text;

namespace OnlineStore.Model
{
    public class MainModel:NotifyBase
    {
        private double progress = 0;
        /// <summary>
        /// 任务进度
        /// </summary>
        public double Progress
        {
            get { return progress; }
            set { progress = value; this.DoNotify(); }
        }

        private StringBuilder taskInfo = new StringBuilder();
        /// <summary>
        /// 主窗口任务日志内容
        /// </summary>
        public string TaskInfo
        {
            get { return taskInfo.ToString(); }
            set { taskInfo.AppendLine(value); this.DoNotify(); }
        }

        
        private bool isBack = false;
        /// <summary>
        /// 是否后台模式
        /// </summary>
        public bool IsBack 
        {
            get { return isBack; }
            set { isBack = value; this.DoNotify(); }
        }

        
        private bool isCycle = false;
        /// <summary>
        /// 是否循环任务
        /// </summary>
        public bool IsCycle
        {
            get { return isCycle; }
            set { isCycle = value; this.DoNotify(); }
        }

        
        private bool isClose = false;
        /// <summary>
        /// 是否完成关机
        /// </summary>
        public bool IsClose
        {
            get { return isClose; }
            set { isClose = value; this.DoNotify(); }
        }


        private string content = "开始执行";
        /// <summary>
        /// 开始执行按钮文本
        /// </summary>
        public string Content
        {
            get { return content; }
            set { content = value; this.DoNotify(); }
        }

        private bool isCheck;

        public bool IsCheck
        {
            get { return isCheck; }
            set { isCheck = value; this.DoNotify(); }
        }



        /// <summary>
        /// 清除日志内容
        /// </summary>
        public void CleanInfo()
        {
            taskInfo.Clear();
        }
    }
}
